<template>
  <el-container>

    <!--      左边侧边栏 -->
    <el-aside :width="menuStore.menuWidth" class="transition-all">
      <AdminMenu></AdminMenu>
    </el-aside>

    <el-container>
      <el-header>
        <AdminHeader></AdminHeader>
      </el-header>
      <el-main>
        <AdminTagList></AdminTagList>

        <!-- 主内容（根据路由动态展示不同页面） -->
        <router-view v-slot="{Component}">
          <Transition name="fade">
            <!--max 最大缓存10个组件          -->
            <keep-alive :max="10">
              <component :is="Component"></component>
            </keep-alive>
          </Transition>
        </router-view>
      </el-main>

      <el-footer>
        <AdminFooter></AdminFooter>
      </el-footer>
    </el-container>




  </el-container>
</template>

<script setup>
import AdminFooter from "@/layouts/admin/components/AdminFooter.vue";
import AdminTagList from "@/layouts/admin/components/AdminTagList.vue";
import AdminMenu from "@/layouts/admin/components/AdminMenu.vue";
import AdminHeader from "@/layouts/admin/components/adminHeader.vue";
import {useMenuStore} from "@/stores/menu.js";

const menuStore = useMenuStore();

</script>


<style scoped>
.el-header{
  padding: 0 !important;
}

.el-footer {
  padding: 0!important;
}


/* 内容区域过渡动画：淡入淡出效果 */
/* 刚开始进入时 */
.fade-enter-from{
  opacity: 0;
}
/* 刚开始结束 */
.fade-leave-to{
  opacity: 1;
}
/* 刚开始离开 */
.fade-leave-from {
  opacity: 1;
}

/* 离开已结束 */
.fade-leave-to {
  opacity: 0;
}
/* 进入进行中 */
.fade-enter-active{
  transition: all 0.3s;
  transition-delay: 0.3s;
}
/* 离开进行中 */
.fade-leave-active {
  transition: all 0.3s ;
}



</style>
